package com.air.service.impl;

import com.air.dao.OrderMapper;
import com.air.entity.Order;
import com.air.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public Order getOrderById(int orderId, long userId) {
        Order orderById = orderMapper.getOrderById(orderId, userId);
        System.out.println("订单Service"+orderById);
        return orderById;
    }

    @Override
    public Order getOrderById(int orderId) {
        Order orderById = orderMapper.getOrderByOrderId(orderId);
        System.out.println("订单Service支付后"+orderById);
        return orderById;
    }

    @Override
    public int updateOrderById(String trade_no, String out_trade_no) {
        return orderMapper.updateOrderById(trade_no, out_trade_no);
    }

    @Override
    public List<Order> getOrderList(long userId) {
        return orderMapper.getOrderList(userId);
    }

    @Override
    public Order getOrderByYiDaDui(int flightId, long id, int cang) {
        return orderMapper.getOrderByYiDaDui(flightId,id,cang);
    }
}
